import request from '@/utils/request'
import store from '@/store'

// 频道
export * from '@/api/channel'
// 文章
export * from '@/api/article'

// 搜索
export * from '@/api/search'

// 获取评论列表
export * from '@/api/comment'

// 用户--接口
export * from '@/api/user'

// 用户登录
export const loginAPI = ({ mobile, code }) => {
  return request({
    url: '/v1_0/authorizations',
    method: 'POST',
    data: {
      mobile,
      code
    }
  })
}

// token续签
export const refreshTokenAPI = () => request({
  url: '/v1_0/authorizations',
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${store.state.refresh_token}`
  }
})
